/**
 * 
 */
package ac.technion.StreamMania.application.state;

import ac.technion.gcframework.membership.Member;

/**
 * Contains the minimal required information about chat participant
 * 
 * @author advinsky
 * 
 * Date 20/02/2011
 * 
 */
public class Person
{
	private final String m_strName;
	private final Member m_member;
	private final boolean m_isSender;
	
	public Person(String name, Member member, boolean isSender)
	{
		m_strName = name;
		m_member = member;
		m_isSender = isSender;
	}
	
//	public Person(String name, Member member)
//	{
//		m_strName = name;
//		m_member = member;
//		m_isSender = false;
//	}

	public String getName()
	{
		return m_strName;
	}

	public Member getMember()
	{
		return m_member;
	}
	
	public boolean getIsSender()
	{
		return m_isSender;
	}
	
	public boolean equals(Object obj)
	{
		if (obj == null || !(obj instanceof Person))
			return false;
		
		return m_member.equals(((Person)obj).m_member);
	}
	
	public int hashCode()
	{
		return m_member.hashCode();
	}
}
